From: Florian Müllner Date: Tue, 27 Mar 2012 13:26:20 +0000 (+0200) Subject: panel: Add keyboard shortcut to open app menu X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6716 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c51acf7c2ab508133d02f99c617e076b7ba8c95b;p=gnome-shell.git panel: Add keyboard shortcut to open app menu With the application menu now being more than a stub, it has become a much more interesting target, so add a keyboard shortcut to open it directly. This should also ease some of the pain for focus-follows-mouse users. https://bugzilla.gnome.org/show_bug.cgi?id=672909 --- diff --git a/data/org.gnome.shell.gschema.xml.in b/data/org.gnome.shell.gschema.xml.in index acf6adeb5..92a239f25 100644 --- a/data/org.gnome.shell.gschema.xml.in +++ b/data/org.gnome.shell.gschema.xml.in @@ -64,6 +64,7 @@ value here is from the GsmPresenceStatus enumeration. + @@ -78,6 +79,17 @@ value here is from the GsmPresenceStatus enumeration. + + + ["<Super>F10"] + <_summary>Keybinding to open the application menu + <_description> + Keybinding to open the application menu. + + + + diff --git a/js/ui/panel.js b/js/ui/panel.js index ef240a5e0..329f118fc 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -4,6 +4,7 @@ const Cairo = imports.cairo; const Clutter = imports.gi.Clutter; const Gio = imports.gi.Gio; const GLib = imports.gi.GLib; +const Gtk = imports.gi.Gtk; const Lang = imports.lang; const Mainloop = imports.mainloop; const Meta = imports.gi.Meta; @@ -1112,6 +1113,15 @@ const Panel = new Lang.Class({ return true; }, + openAppMenu: function() { + let menu = this._appMenu.menu; + if (Main.overview.visible || menu.isOpen) + return; + + menu.open(); + menu.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false); + }, + startStatusArea: function() { for (let i = 0; i < this._status_area_order.length; i++) { let role = this._status_area_order[i]; diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index 69f8e194f..1e2b2f447 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -13,6 +13,7 @@ const WorkspaceSwitcherPopup = imports.ui.workspaceSwitcherPopup; const Main = imports.ui.main; const Tweener = imports.ui.tweener; +const SHELL_KEYBINDINGS_SCHEMA = 'org.gnome.shell.keybindings'; const WINDOW_ANIMATION_TIME = 0.25; const DIM_TIME = 0.500; const UNDIM_TIME = 0.250; @@ -134,6 +135,10 @@ const WindowManager = new Lang.Class({ Lang.bind(this, this._startAppSwitcher)); Meta.keybindings_set_custom_handler('switch-panels', Lang.bind(this, this._startA11ySwitcher)); + global.display.add_keybinding('open-application-menu', + SHELL_KEYBINDINGS_SCHEMA, + Meta.KeyBindingFlags.NONE, + Lang.bind(this, this._openAppMenu)); Main.overview.connect('showing', Lang.bind(this, function() { for (let i = 0; i < this._dimmedWindows.length; i++) @@ -547,6 +552,10 @@ const WindowManager = new Lang.Class({ Main.ctrlAltTabManager.popup(backwards, binding.get_mask()); }, + _openAppMenu : function(display, screen, window, event, binding) { + Main.panel.openAppMenu(); + }, + _showWorkspaceSwitcher : function(display, screen, window, binding) { if (screen.n_workspaces == 1) return;